<template>
  <div class="footer-wrap">
    <ul class="menu-wrap">
      <li v-for="(item, index) in munuList" :key="index">
        {{ item.name }}
      </li>
    </ul>
    <div class="line"></div>
    <div class="version-info">
      <div class="left">
        <img src="@/assets/images/home/government.png" alt="" />
        <div>
          <div>
            鄂ICP备2024034968号-1 政府网站标识码:4201000013邮政编码:430075
          </div>
          <div>
            版权所有@湖北科创供应链有限公司
            技术支持单位:武汉光谷数字产业集团有限公司
          </div>
        </div>
      </div>
      <div class="right">
        <div class="qr-code">
          <img src="@/assets/images/home/qr-code.png" alt="" />
          <div>创新光谷</div>
        </div>
        <div class="about-wrap">
          <div class="about-platform">关于平台</div>
          <ul>
            <li>平台简介</li>
            <li>平台资讯</li>
            <li>联系我们</li>
            <li>问题反馈</li>
          </ul>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  components: {},
  data() {
    return {
      theme: this.$store.state.settings.theme,
      sideTheme: this.$store.state.settings.sideTheme,
      munuList: [
        { name: "知名高校" },
        { name: "技术转移机构" },
        { name: "知识产权服务机构" },
        { name: "知名院所" },
        { name: "投资机构" },
      ],
      currentIndex: 0,
    };
  },
  computed: {
    visible: {
      get() {
        return this.$store.state.settings.showSettings;
      },
    },
    fixedHeader: {
      get() {
        return this.$store.state.settings.fixedHeader;
      },
      set(val) {
        this.$store.dispatch("settings/changeSetting", {
          key: "fixedHeader",
          value: val,
        });
      },
    },
    topNav: {
      get() {
        return this.$store.state.settings.topNav;
      },
      set(val) {
        this.$store.dispatch("settings/changeSetting", {
          key: "topNav",
          value: val,
        });
        if (!val) {
          this.$store.dispatch("app/toggleSideBarHide", false);
          this.$store.commit(
            "SET_SIDEBAR_ROUTERS",
            this.$store.state.permission.defaultRoutes
          );
        }
      },
    },
    tagsView: {
      get() {
        return this.$store.state.settings.tagsView;
      },
      set(val) {
        this.$store.dispatch("settings/changeSetting", {
          key: "tagsView",
          value: val,
        });
      },
    },
    sidebarLogo: {
      get() {
        return this.$store.state.settings.sidebarLogo;
      },
      set(val) {
        this.$store.dispatch("settings/changeSetting", {
          key: "sidebarLogo",
          value: val,
        });
      },
    },
    dynamicTitle: {
      get() {
        return this.$store.state.settings.dynamicTitle;
      },
      set(val) {
        this.$store.dispatch("settings/changeSetting", {
          key: "dynamicTitle",
          value: val,
        });
      },
    },
  },
  methods: {
    // 切换菜单
    changeMenu(val, path) {
      console.log(path, "path====");
      this.currentIndex = val;
      this.$router.push({ path: path });
    },
    themeChange(val) {
      this.$store.dispatch("settings/changeSetting", {
        key: "theme",
        value: val,
      });
      this.theme = val;
    },
    handleTheme(val) {
      this.$store.dispatch("settings/changeSetting", {
        key: "sideTheme",
        value: val,
      });
      this.sideTheme = val;
    },
    saveSetting() {
      this.$modal.loading("正在保存到本地，请稍候...");
      this.$cache.local.set(
        "layout-setting",
        `{
            "topNav":${this.topNav},
            "tagsView":${this.tagsView},
            "fixedHeader":${this.fixedHeader},
            "sidebarLogo":${this.sidebarLogo},
            "dynamicTitle":${this.dynamicTitle},
            "sideTheme":"${this.sideTheme}",
            "theme":"${this.theme}"
          }`
      );
      setTimeout(this.$modal.closeLoading(), 1000);
    },
    resetSetting() {
      this.$modal.loading("正在清除设置缓存并刷新，请稍候...");
      this.$cache.local.remove("layout-setting");
      setTimeout("window.location.reload()", 1000);
    },
  },
};
</script>

<style lang="scss" scoped>
.footer-wrap {
  padding: 50px 250px;
  background-color: #000;
  .menu-wrap {
    display: flex;
    justify-content: space-between;
    li {
      width: 500px;
      height: 40px;
      line-height: 40px;
      background-color: #383838;
      color: #fff;
      font-family: SourceHanSansCN-VF-2;
      font-size: 16px;
      font-weight: 400;
      text-align: center;
      margin-right: 30px;
      &:last-child {
        margin-right: 0;
      }
    }
  }
  .line {
    height: 1px;
    background-color: #383838;
    margin-top: 30px;
    margin-bottom: 50px;
  }
  .version-info {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    .left {
      display: flex;
      justify-content: flex-start;
      color: #fff;
      font-size: 16px;
      margin-left: 100px;
      margin-right: 100px;
      img {
        margin-right: 50px;
      }
    }
    .right {
      display: flex;
      justify-content: flex-start;
      align-items: top;
      .qr-code {
        color: #fff;
        font-size: 16px;
      }
      .about-wrap {
        margin-top: 20px;
        margin-left: 20px;
        ul {
          display: flex;
          justify-content: flex-start;
          margin-top: 10px;
          li {
            color: #fff;
            font-size: 16px;
          }
        }
      }
      .about-platform {
        color: rgb(13, 134, 255);
        font-size: 16px;
      }
    }
  }
}
</style>
